package day16.晚间练习.Udp通信程序练习;

import java.io.IOException;
import java.net.*;
import java.util.Scanner;

public class SendDemo {
    public static void main(String[] args) throws IOException {
        DatagramSocket ds=new DatagramSocket();
        Scanner sc=new Scanner(System.in);
        while (true){
            String s=sc.nextLine();
            if (s.equals("886")){
                break;
            }
            byte[] bytes=s.getBytes();
            DatagramPacket dp=new DatagramPacket(bytes,bytes.length, InetAddress.getByName("192.168.23.127"),10001);
            ds.send(dp);
            ds.close();
        }
    }
}
